import App from './App'
import Vue from 'vue'

import store from './store/index.js'  


Vue.config.productionTip = false

Vue.prototype.app = App

App.mpType = 'app'

// 时间过滤器
Vue.filter('timeSort', (time)=>{
	var b = parseInt(time)
	var c = b%60||0
	var d = parseInt(b/60)||0
	c = c>9?c:'0'+c
	return d+":"+c
})
// const iac = uni.createInnerAudioContext();
Vue.prototype.iac = uni.createInnerAudioContext();
const iac = Vue.prototype.iac;
console.log(iac)
//播放
Vue.prototype.$play = function(){
	this.$store.commit('nowPlayChange', {
		playState:true
	})
	iac.play();
}
//暂停
Vue.prototype.$pause = function(){
	this.$store.commit('nowPlayChange', {
		playState:false
	})
	iac.pause();
	
}
//下一首
Vue.prototype.$nextSong = function(song){
	this.$store.commit('songChange',{
		id: 1474342935,
				image: 'https://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg',
				url: "",
				// url: 'http://m7.music.126.net/20200920221019/d64e8d21503b3b45e7637e29c06583bd/ymusic/obj/w5zDlMODwrDDiGjCn8Ky/3045976692/8720/40bf/be20/679b48e199208b54539ff50695771e98.mp3',
				author: '',
				title: '',
				lyric: ''
	})
}

const app = new Vue({
	store,
    ...App
})
app.$mount()
console.log('index.js',store)